home *** CD-ROM | disk | FTP | other *** search
- Path: news.scsn.net!usenet
- From: shrader@scsn.net (Scott Shrader)
- Newsgroups: comp.lang.c
- Subject: Re: Beginer C please help me
- Date: 21 Mar 1996 00:13:46 GMT
- Organization: South Carolina SuperNet, Inc.
- Message-ID: <4iq6vq$evq@daryl.scsn.net>
- References: <DoLCFx.B7x.0.bloor@torfree.net>
- NNTP-Posting-Host: cola71.scsn.net
- Mime-Version: 1.0
- Content-Type: Text/Plain; charset=US-ASCII
- X-Newsreader: WinVN 0.99.7
-
- In article <DoLCFx.B7x.0.bloor@torfree.net>, bz786@torfree.net says...
- >
- >This may be a stupid mistake but "please help" me.
- >Thank you very much.
- >
- >#include <stdio.h>
- >#include <math.h>
- >main ()
- >{
- >float n;
- >n=(9/5);
- >printf ("n= %1.3f\n", n);
- >}
- >I have complied and run the programme & I got the answer n=1.000
- >but Iam supposed to get answer 1.8.
- >Why I got this answer?
- >--
- you can write this by skipping printf("n= %1.3f\n", n); and put in
- printf("%f",n);
-
- Try this to see how this works.
-
- I'm a bit new at this too, but I think this will work.
-
- Yours,
- Scott
- shrader@scsn.ner
-
-